from langchain_cohere import CohereRerank

from langchain.retrievers.document_compressors.base import DocumentCompressorPipeline
from langchain.retrievers.document_compressors.chain_extract import (
    LLMChainExtractor,
)
from langchain.retrievers.document_compressors.chain_filter import (
    LLMChainFilter,
)
from langchain.retrievers.document_compressors.cohere_rerank import CohereRerank
from langchain.retrievers.document_compressors.cross_encoder_rerank import (
    CrossEncoderReranker,
)
from langchain.retrievers.document_compressors.embeddings_filter import (
    EmbeddingsFilter,
)
from langchain.retrievers.document_compressors.listwise_rerank import (
    LLMListwiseRerank,
) 

from sentence_transformers.cross_encoder import CrossEncoder

reranker = CrossEncoder("cross-encoder/ms-marco-MiniLM-L-6-v2")
reranked_docs = reranker.rank("水果", ["你好","实名制","苹果"])

print(reranked_docs)
 